package sugarbind_input

class Binding_Strength {

    String binding_Strength_Name
	String binding_Strength_Rank
	
    static constraints = {
			binding_Strength_Name(blank:false)
			binding_Strength_Name(unique:true)
	}
	
	static hasMany = [bindings: Binding]
	
	static mapping = {
//		id column: 'binding_strength_id'
		id generator: 'sequence', params: [sequence: 'binding_strength_id_seq']
	}
	
	public String toString(){
		String s = ""
		if(binding_Strength_Rank!=null && !binding_Strength_Rank.isEmpty())
		{
			s += binding_Strength_Rank + " - "
		}
		s += binding_Strength_Name// + " " + id
		return s
	}
	
	public static listBinding_Strengths()
	{
		Binding_Strength.list().sort{ it.toString(); }
	}
}
